#ifndef TRADE_H_
#define TRADE_H_

#include "Transaction.h"

class Trade: public Transaction {
public:
	Trade() {
		/*stringstream ss;
		last_TradeID++;
		ss<<"TT";
		ss << (int) last_TradeID;
		tradeID=ss.str();*/
	}
	Trade(vector<Item> _items,Date _date, string _starterID, string _enderID): Transaction(_date, _starterID, _enderID),items(_items) {
		stringstream ss;
		last_TradeID++;
		ss<<"TT";
		ss << (int) last_TradeID;
		tradeID=ss.str();
	}
	Trade(vector<Item> _items,Date _date, string _starterID,string _enderID, bool _isEnded): Transaction(_date, _starterID, _enderID,_isEnded),items(_items) {
		stringstream ss;
		last_TradeID++;
		ss<<"TT";
		ss << (int) last_TradeID;
		tradeID=ss.str();
	}
	virtual ~Trade() {}

	/** @return ID of trade */
	string getID() const { return tradeID; }

	/** @return items of trade */
	vector<Item> getItems() const { return items; }

	/** sets items of trade equal to _items */
	void setItemsOwner(vector<Item> & _items) {}

	/** Adds item _item to items */
	void addItem(Item _item);

	/** Adds the trade's data to the records filename */
	void save(string filename, ofstream & out);

	/** Shows the information about the trade */
	void showTransaction();

private:
	string tradeID;
	static unsigned int last_TradeID;
	vector<Item> items;
};

#endif /* TRADE_H_ */
